#include <vector>
#include <thread>
#include <string>

#pragma once

namespace kawauso {

    struct LoggerOptions {
        bool     enableFileStorage = true;
        uint32_t maxFileSize       = 8096;
    };

    struct NetworkOptions {

        struct DirectDeviceInfo {
            std::string pciAddress;
        };

        struct EmulateDeviceInfo {
            std::string attachInterface;
        };

        std::vector<DirectDeviceInfo>  directDevices;
        std::vector<EmulateDeviceInfo> emulateDevices;
        uint16_t emptyRxPollThreshold = 50;
    };

    struct RuntimeOptions {
        uint16_t coreThreadNum    = std::thread::hardware_concurrency();
        uint16_t suspendThreshold = 300;
        uint16_t maxSuspendTime   = 1000;
    };

    struct GeneralOptions {
        LoggerOptions  loggerOptions;
        NetworkOptions networkOptions;
        RuntimeOptions runtimeOptions;

        /**
         * Read options from file.
         * @param filepath file which contains options
         */
        static GeneralOptions readFromFile(const std::string &filepath);
    };

}
